package wrapper_package;

public class EqualEqualBehaviour
{
	public static void main(String[] args) 
	{
		/* If following wrapper objects
		 * - Boolean,
		 * - Byte,
		 * - Character from \u0000 to \u007f,
		 * - Short & Integer from -128 to 127
		 * are created through BOXING will be == if they have same value 
		 */
		Integer a = 128;
		Integer b = 128;
		System.out.println(a==b);
		
		Integer c = 127;
		Integer d = 127;
		System.out.println(c==d);
		
		// Here wrapper object is created using constructor
		Integer e = new Integer("128");
		Integer f = new Integer("128");
		System.out.println(e==f);
		
		Integer g = new Integer("127");
		Integer h = new Integer("127");
		System.out.println(g==h);
		
		Boolean bool1 = true;
		Boolean bool2 = true;
		System.out.println(bool1==bool2);
		
		Boolean bool3 = new Boolean("true");
		Boolean bool4 = new Boolean("true");
		System.out.println(bool3==bool4);
	}

}
